package com.cardone.platform.usercenter.service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;


import lombok.Getter;


import lombok.Setter;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;

import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.context.Attributes;
import com.cardone.context.ContextHolder;
import com.cardone.common.util.EntityUtils;
import com.cardone.platform.usercenter.dao.UserActivationDao;
import com.cardone.platform.usercenter.dto.UserActivationDto;

/**
 * 用户激活服务
 *
 * @author yaohaitao
 * 
 */
@Getter 
@Setter
@Transactional(readOnly = true)
public class UserActivationDefaultService implements UserActivationService {
	@Override
	@Transactional
	public <P> P saveByIdOrCode(Class<P> mappedClass, UserActivationDto saveUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).saveByIdOrCode(mappedClass, saveUserActivation);
	}
	
	@Override
	@Transactional
	public UserActivationDto saveByIdOrCode(UserActivationDto saveUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).saveByIdOrCode(UserActivationDto.class, saveUserActivation);
	}
	
	@Override
	public <P> P findByCodeOrId(Class<P> mappedClass, UserActivationDto findUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).findByCodeOrId(mappedClass, findUserActivation);
	}
	
	@Override
	public Integer readByCodeNqIdForCount(UserActivationDto readUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).readByCodeNqIdForCount(readUserActivation);
	}
	
	@Override
	@Transactional
	public int insertByCode(UserActivationDto insertUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).insertByCode(insertUserActivation);
	}
	
	@Override
	@Transactional
	public int updateByCode(UserActivationDto updateUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).updateByCode(updateUserActivation);
	}

	@Override
	@Transactional
	public int deleteByIds(UserActivationDto deleteUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).deleteByIds(deleteUserActivation);
	}

	@Override
	public <P> P findById(Class<P> mappedClass, UserActivationDto findUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).findById(mappedClass, findUserActivation);
	}

	@Override
	public <P> List<P> findListByLikeCode(Class<P> mappedClass, UserActivationDto findListUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).findListByLikeCode(mappedClass, findListUserActivation);
	}

	@Override
	public <P> List<P> findList(Class<P> mappedClass) {
		return ContextHolder.getBean(UserActivationDao.class).findList(mappedClass);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, UserActivationDto paginationUserActivation) {
		return ContextHolder.getBean(UserActivationDao.class).paginationByLikeCode(mappedClass, paginationUserActivation);
	}
}